#include "approver.h"
#include "request.h"

int main(int argc, char *argv[])
{
    // 构建责任链
    GroupApprover    *groupApprover    = new GroupApprover(1);
    MinisterApprover *ministerApprover = new MinisterApprover(3);
    ManagerApprover  *managerApprover  = new ManagerApprover();
    groupApprover->setSuccessor(ministerApprover);
    ministerApprover->setSuccessor(managerApprover);

    // 张三发起审批请求
    LeaveRequest zhangRequest("张三", 1);
    groupApprover->processRequest(&zhangRequest);

    // 李四发起审批请求
    LeaveRequest liRequest("李四", 3);
    groupApprover->processRequest(&liRequest);

    // 王五发起审批请求
    LeaveRequest wangRequest("王五", 5);
    groupApprover->processRequest(&wangRequest);
    return 0;
}